<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <title>隐私政策</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="hotcss" content="design-width=640 max-width=640 initial-dpr=1">
    <link href="/vendor/layui-v2.8.8/layui/css/layui.css?v={{ time() }}" rel="stylesheet">
    <script src="/vendor/layui-v2.8.8/layui/layui.js?v={{ time() }}"></script>
    @vite(['resources/scss/policy/index.scss', 'resources/js/juheh5.js'])
</head>
<style>
.body {
    background: url(https://sdk-server.tkumgame.com/images/wan_bg01.jpg)  no-repeat center center fixed;
    background-size: cover;
}
</style>
<body @if($channel==2002) class="body"  @endif>
    <div class="container" id="vapp">
        <div class="policy-container">
            <div class="header">
                <div>个人信息保护协议</div>
            </div>
            <div class="msg">
                <p>
                    请您审慎阅读<a href="{{ $user_url }}">《用户协议》</a>和<a
                        href="{{ $privacy_url }}">《隐私政策》</a>条款，如您已了解各条款，请点击“同意”开始接受我们提供的服务。
                </p>
                <p>
                    为了提供完整的游戏体验，我们会向您申请必要的权限和信息。您可选择允许或拒绝权限，如果拒绝可能会导致部分游戏体验异常，请须知。
                </p>
            </div>
            <div class="oper">
                <div class="agree" v-on:click="sendChoose(1)">
                    <div class="btn">同意</div>
                </div>
                <div class="reject" v-on:click="sendChoose(0)">
                    <div class="btn">不同意</div>
                </div>
            </div>
        </div>
    </div>
    </div>
</body>
<script>
    document.addEventListener('DOMContentLoaded', function() {
        const app = vueCreateApp({
            data() {
                return {
                    gameId: {{ $game_id }},
                    deviceNum: '{{ $device_num }}'
                }
            },
            mounted() {},
            methods: {
                sendChoose(is_agree) {
                    var _this = this
                    var params = {}
                    params.device_num = _this.deviceNum
                    params.game_id = _this.gameId
                    params.is_agree = is_agree
                    http.post('/api/policy/choose', params, function(code, msg, data) {
                        if (code !== 0) {
                            layer.msg(msg)
                            return
                        }
                        // 如果是不同意，则直接返回无需后续操作
                        if (is_agree === 0) {
                            layer.msg('请同意后才能继续游戏')
                            return
                        }
                        // 将结果返回给安卓
                        if (window.Juheh5) {
                            window.Juheh5.policyCb(0, 'success', JSON.stringify({
                                device_num: _this.deviceNum
                            }))
                        }
                    }, true);
                }
            }
        })
        app.mount('#vapp')
    })
</script>

</html>
